int rootOfEquation(double a, double b, double c, double *x1, double *x2) {
    double discriminant = b * b - 4 * a * c; 

    if (discriminant < 0) {
        return 0; 
    } else if (discriminant == 0) {
        *x1 = *x2 = -b / (2 * a);  
        return 1;
    } else {
        double sqrt_discriminant = sqrt(discriminant);  
        *x1 = (-b + sqrt_discriminant) / (2 * a); 
        *x2 = (-b - sqrt_discriminant) / (2 * a); 
        
        if (*x1 < *x2) {
            double temp = *x1;
            *x1 = *x2;
            *x2 = temp;
        }
        
        return 2;  
    }
}